package com.android.rapidcash.view

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageButton
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.rapidcash.abanca.santander.vivus.revolut.waylet.libertex.icmarkets.caixabank.R


class TopBar : FrameLayout {

    constructor(context: Context) : super(context) {
        initView(context)
    }

    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
        initView(context)
    }

    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ) {
        initView(context)
    }

    lateinit var mIvBack: ImageView
    lateinit var mTvRightTitle: ImageView
    lateinit var mTvTitle: TextView

    @SuppressLint("RtlHardcoded")
    private fun initView(context: Context) {
        val view: View = LayoutInflater.from(context).inflate(R.layout.item_top_bar, this, true)
        mIvBack = view.findViewById<ImageView>(R.id.iv_back)
        mTvTitle = view.findViewById<TextView>(R.id.tv_title)
        mTvRightTitle = view.findViewById<ImageView>(R.id.iv_right_icon)

        mIvBack.setOnClickListener { (context as AppCompatActivity).finish() }

    }

}


